home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 05.zip / BS1 part 5 / IM_3 .adf / Exec / install-pi < prev    next >
Text File  |  1992-08-20  |  8KB  |  271 lines

  1. ;---------------------------------------------------------------------
  2. ;Install-pi script ------ version 1.05 ------- written for the 2.04 OS
  3. ;---------------------------------------------------------------------
  4. ;Written by Ben Williams - January 23rd, 1992
  5. ;           Last updated - April 29th, 1992
  6. ;
  7. ;This exec file installs the Public Interface Executive for
  8. ;Black Belt Systems' image processing tools.
  9. ;
  10. ;Pre-existing Requirements:
  11. ;--------------------------
  12. ;1 - ARexx must be installed; 2.04 comes with ARexx installed normally
  13. ;    so this shouldn't be a problem
  14. ;
  15. ;2 - There must be room to hold the new commands (1 meg or so)
  16. ;    If you don't have enough room, the script will fail
  17. ;
  18. ;3 - The rename, delete, cd and copy commands must be in the user's PATH
  19. ;    We use these to complete the operations in the script
  20. ;
  21. ;4 - There must be sufficient ram available (also about 1 meg)
  22. ;    The files are temporarily held in ram:
  23. ;
  24. ;5 - REXX: and C: must be assigned to somewhere on a hard disk with 1M free.
  25. ;    This is the 2.04 system default; although some *idiot* at CBM made
  26. ;    the "s:" directory the rexx: directory
  27. ;
  28. ;The archive contains:
  29. ;---------------------
  30. ; - A number of PI .rexx scripts
  31. ; - A number of PI command components
  32. ; - The list.list text file
  33. ; - The picmdpath text file
  34. ; - The Launch.rexx script
  35. ; - The Default.ipmcr macro startup file
  36. ; - The Default.immcr macro startup file
  37. ; - The Default.iimcr macro startup file
  38. ;
  39. ;Operations Performed by this script:
  40. ;------------------------------------
  41. ; - A temporary directory called "ram:pitdir" is created
  42. ; - The permanent directories c:cmpi and rexx:rxpi are created IF they
  43. ;   don't already exist and RXPI and CMPI don't already exist
  44. ; - Volatile assignments CMPI: and RXPI: are made to these directories unless
  45. ;   they were already made
  46. ; - The launch.rexx script and the text file "picmdpath" are copied to REXX:
  47. ; - The small textfile "list.list" is copied to CMPI:
  48. ; - A number of ARexx scripts are copied to RXPI:
  49. ; - A number of command components are copied to CMPI:
  50. ; - New default files for the image processors are copied to s:
  51. ; - The temporary directory in ram is removed
  52. ;
  53. ;Remaining jobs for the user to do:
  54. ;----------------------------------
  55. ;add these two lines to their s:user-startup file:
  56. ;
  57. ;   assign RXPI: rexx:rxpi
  58. ;   assign CMPI: c:cmpi
  59. ;---------------------------------------------------------------------
  60.  
  61. ;-----------------------------------------
  62. ;Check that everything we need is in place
  63. ;-----------------------------------------
  64. assign >nil: exists REXX:
  65. If WARN
  66.   Echo "ARexx REXX: assignment not found - Cannot install!"
  67.   Quit
  68.   endif
  69.  
  70. assign >nil: exists c:
  71. If WARN
  72.   Echo "System C: assignment not found - Cannot install!"
  73.   Quit
  74.   Endif
  75.  
  76. assign >nil: exists s:
  77. If WARN
  78.   Echo "System S: assignment not found - Cannot install!"
  79.   Quit
  80.   Endif
  81.  
  82. If NOT EXISTS ram:piarc.lzh
  83.   Echo "RAM:PIARC.LZH file not found - Cannot install!"
  84.   Quit
  85.   Endif
  86.  
  87. If NOT EXISTS ram:extract
  88.   Echo "RAM:EXTRACT file not found - Cannot install!"
  89.   Quit
  90.   Endif
  91.  
  92. If NOT EXISTS ram:VolFree
  93.   Echo "RAM:VOLFREE file not found - Cannot install!"
  94.   Quit
  95.   Endif
  96.  
  97. If NOT EXISTS ram:RamFree
  98.   Echo "RAM:RAMFREE file not found - Cannot install!"
  99.   Quit
  100.   Endif
  101.  
  102. ;--------------------------------------------------
  103. ;Make sure user has enough memory for us to operate
  104. ;--------------------------------------------------
  105. RamFree total 1000000
  106. If WARN
  107.   Echo "Not enough memory to run install! We need a megabyte to do the"
  108.   Echo "installation, which we will return to the system afterwards."
  109.   Quit
  110.   EndIf
  111.  
  112. ;-------------------------------------------------------
  113. ;Check disk(s) to see if we have enough space to install
  114. ;-------------------------------------------------------
  115. assign >nil: exists CMPI:
  116. If WARN
  117.   VolFree c: 1000000
  118.   If WARN
  119.     Echo "Not enough disk space on Volume where ``c:'' is located"
  120.     Echo "We need about a megabyte of free disk space there."
  121.     Quit
  122.     EndIf
  123.   EndIf
  124.  
  125. assign >nil: exists RXPI:
  126. If WARN
  127.   VolFree rexx: 100000
  128.   If WARN
  129.     Echo "Not enough disk space on Volume where ``rexx:'' is located"
  130.     Echo "We need about 100k bytes of free disk space there."
  131.     Quit
  132.     EndIf
  133.   EndIf
  134.  
  135. VolFree s: 15000
  136. If WARN
  137.   Echo "Not enough disk space on Volume where ``s:'' is located"
  138.   Echo "We need about 15k bytes of free disk space there."
  139.   Quit
  140.   EndIf
  141.  
  142. ;-------------------------------------------------
  143. ;Create the temporary directory from which to copy
  144. ;-------------------------------------------------
  145. If NOT EXISTS ram:pitdir
  146.   makedir ram:pitdir
  147. Else
  148.   delete ram:pitdir/#? all quiet
  149.   Endif
  150.  
  151. ;------------------------------------------
  152. ;Attempt to make the directories we'll need
  153. ;unless user has already specified these
  154. ;somehow (a techie might do this to us)
  155. ;------------------------------------------
  156. assign >nil: exists CMPI:
  157. If WARN
  158.   If NOT EXISTS c:cmpi
  159.     makedir c:cmpi
  160.     Endif
  161.   assign CMPI: c:cmpi
  162.   Endif
  163.  
  164. assign >nil: exists RXPI:
  165. If WARN
  166.   If NOT EXISTS rexx:rxpi
  167.     makedir rexx:rxpi
  168.     Endif
  169.   assign RXPI: rexx:rxpi
  170.   Endif
  171.  
  172. ;----------------------------
  173. ;Recover the files we'll need
  174. ;----------------------------
  175. cd ram:pitdir
  176. copy c:delete to ram:pitdir
  177. copy c:copy to ram:pitdir
  178. copy c:rename to ram:pitdir
  179. ram:extract e ram:piarc
  180.  
  181. ;---------------------------------------------
  182. ;Save the user's old macro files if they exist
  183. ;---------------------------------------------
  184. If EXISTS s:Default.immcr.old
  185.   ram:pitdir/Delete s:Default.immcr.old
  186.   endif
  187. If EXISTS s:Default.immcr
  188.   ram:pitdir/rename s:Default.immcr s:Default.immcr.old
  189.   endif
  190.  
  191. If EXISTS s:Default.iimcr.old
  192.   ram:pitdir/Delete s:Default.iimcr.old
  193.   endif
  194. If EXISTS s:Default.iimcr
  195.   ram:pitdir/rename s:Default.iimcr s:Default.iimcr.old
  196.   endif
  197.  
  198. If EXISTS s:Default.ipmcr.old
  199.   ram:pitdir/Delete s:Default.ipmcr.old
  200.   endif
  201. If EXISTS s:Default.ipmcr
  202.   ram:pitdir/rename s:Default.ipmcr s:Default.ipmcr.old
  203.   endif
  204.  
  205. ;-----------------------------
  206. ;Copy the special files first:
  207. ;-----------------------------
  208. ram:pitdir/copy list.list to CMPI:
  209. ram:pitdir/copy picmdpath to REXX:
  210. ram:pitdir/copy launch.rexx to REXX:
  211. ram:pitdir/copy Default.ipmcr to s:
  212. ram:pitdir/copy Default.iimcr to s:
  213. ram:pitdir/copy Default.immcr to s:
  214. ram:pitdir/Delete launch.rexx list.list picmdpath Default.#?mcr QUIET
  215.  
  216. ;-------------------------------------
  217. ;Copy the PI Module ARexx scripts next
  218. ;-------------------------------------
  219. ram:pitdir/copy #?.rexx to RXPI:
  220. ram:pitdir/Delete #?.rexx QUIET
  221.  
  222. ;---------------------------------
  223. ;Copy all the command modules next
  224. ;---------------------------------
  225. ram:pitdir/copy #? to CMPI:
  226. ram:pitdir/Delete CMPI:Delete CMPI:Copy CMPI:Rename QUIET
  227.  
  228. ;-----------------------------------------------
  229. ;If old rdjpg or wrjpg commands exist, kill them
  230. ;-----------------------------------------------
  231. If EXISTS CMPI:rdjpg
  232.   ram:pitdir/Delete CMPI:rdjpg
  233.   EndIf
  234.  
  235. If EXISTS CMPI:wrjpg
  236.   ram:pitdir/Delete CMPI:wrjpg
  237.   EndIf
  238.  
  239. ;----------------------------------------------------
  240. ;Find out if the user has a 68020 or better processor
  241. ;----------------------------------------------------
  242. ask "Do you have a 68020, 68030 or 68040 (Y/N)?"
  243. if WARN
  244.   echo "Installing specially compiled commands for fast CPUs"
  245.   ram:pitdir/rename CMPI:x_JPR030 CMPI:rdjpg
  246.   ram:pitdir/rename CMPI:x_JPW030 CMPI:wrjpg
  247. else
  248.   echo "Installing standard commands"
  249.   ram:pitdir/rename CMPI:x_JPR000 CMPI:rdjpg
  250.   ram:pitdir/rename CMPI:x_JPW000 CMPI:wrjpg
  251. endif
  252.  
  253. ;------------------------------------------------------------------
  254. ;Remove all potential commands, we've already picked what we needed
  255. ;------------------------------------------------------------------
  256. ram:pitdir/Delete CMPI:x_#? QUIET
  257.  
  258. ;-----------------
  259. ;Finally, Clean up
  260. ;-----------------
  261. cd ram:
  262. ram:pitdir/Delete ram:extract QUIET
  263. ram:pitdir/Delete ram:VolFree QUIET
  264. ram:pitdir/Delete ram:RamFree QUIET
  265. ram:pitdir/Delete ram:piarc.lzh QUIET
  266. Delete ram:pitdir ALL QUIET
  267.  
  268. ;All Done!
  269. ;---------
  270. echo "Installation completed. Have fun!"
  271.